Repository navigation
fix(model-downloader): subscribe to progress via the ComfyUI API client - #120
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up from #119.
Problem
model_downloader.jsregistered itsmodel_download_progresslistener only throughwindow.api, which no current frontend defines (they exposewindow.comfyAPI.api.api). Those registrations were no-ops, so:onmessagemonkey-patch fallback.console.error("Unknown message type model_download_progress")for any message type without a listener. 1.52 logged the same thing as a warning.Fix
window.comfyAPI?.api?.api || window.app?.api || window.apiand calladdEventListener('model_download_progress', …)on it.handleMessageEventalready unwrapsCustomEvent.detail.registerExtension,registerMessageHandlerandreportedUnknownMessageTypespaths are removed.Testing
Headless Chromium (Playwright) against
nix run .#defaulton./datawith ComfyUI 0.44.0 and frontend 1.57.6:Unknown message type model_download_progressno longer appears in the console.<a download>click was intercepted, and the backend download completed at 100%. Two progress events reachedhandleMessageEvent.clipspace.js404s, which already existed before this change.